package com.util.timerTask;

import java.io.IOException;
import java.sql.SQLException;

import org.springframework.stereotype.Component;

@Component
public class TimerTask {

	/**
	 * 定期执行网络抓取任务
	 * 
	 * @throws Exception
	 */
	public static void crawlInfo() throws Exception {
		CollectInfo.startCrawl();
		System.out.println("医疗信息库已更新！");
	}

	/***
	 * 更新用户兴趣模型
	 * 
	 * @throws SQLException
	 */
	public static void decayInterestModel() throws SQLException {
		// public static void main(String[] args) throws SQLException{
		// System.out.println("开始更新用户兴趣模型……");
		InterestModel.executeDecayInterestModel();
		// System.out.println("用户兴趣模型已更新！");
	}

	/**
	 * 定期更新信息推荐列表
	 * 
	 * @throws SQLException
	 * @throws IOException
	 */
	public static void getOrUpdateRecNews() throws SQLException, IOException {
		UpdateRecNews updateRecNews = new UpdateRecNews();
		updateRecNews.excuteUpdateRecNews();
		System.out.println("用户信息推荐列表已更新！");
	}

}
